package com.chase.framerwork.entity;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 用户Entity
 * 
 * @author Chase
 * 
 */
@Entity
@Table(name = "SYS_USER")
public class User extends BaseEntity implements Serializable
{

	private static final long serialVersionUID = 738083585258403211L;

	private String username;
	private String password;
	private Integer status;
	
	private Set<Menu> menus;
	
	private String confirmPassword;
	
	public String getUsername()
	{
		return username;
	}

	public void setUsername(String username)
	{
		this.username = username;
	}

	public String getPassword()
	{
		return password;
	}

	public void setPassword(String password)
	{
		this.password = password;
	}

	public Integer getStatus()
	{
		return status;
	}

	public void setStatus(Integer status)
	{
		this.status = status;
	}

	@ManyToMany()
	public Set<Menu> getMenus()
    {
    	return menus;
    }

	public void setMenus(Set<Menu> menus)
    {
    	this.menus = menus;
    }
	
	@Override
	public String toString()
	{
		return "User [username=" + username + ", password=" + password + ", status=" + status + "]";
	}
	
	@Transient
	public String getConfirmPassword()
    {
	    return confirmPassword;
    }
	
	public void setConfirmPassword(String confirmPassword)
    {
	    this.confirmPassword = confirmPassword;
    }
}
